package com.ma.controller;

import com.alibaba.fastjson.JSON;
import com.ma.model.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * author: MaHX
 * date: 2019/5/19/0:14
 * description:
 **/
@RestController
@RequestMapping("ts")
public class JsonController {
    //    private final AppService appService;
//    @GetMapping("/blog")
//    public String clsmsuu(@RequestParam("phone")String phone, @RequestParam("way")String way){
////        return appService.clsmsuu("86"+phone,Integer.valueOf(way));
////        Result result = new Result();
//////        result.setCode(200);
//////        result.setData(phone+way);
//////        result.setInfo("成功");
//        return "123";
//    }
    @PostMapping(value = "/json", produces = "text/plain;charset=UTF-8")
    public String httppost(@RequestParam("phone") String phone, @RequestParam("way") String way) {
        Result result = new Result();
        result.setCode(200);
        result.setData(phone + way);
        result.setInfo("成功");
        return JSON.toJSONString(result);
    }
}
